﻿@{
    Layout = null;
}

<form id="formid" name="myform" method='post'>
    <table border="0">
        <tr>
            <td width="60" height="40" align="right">用户名&nbsp;</td>
            <td><input type="text" value="" class="text2" name="username" id="userid" /></td>
        </tr>
        <tr>
            <td width="60" height="40" align="right">密&nbsp;&nbsp;码&nbsp;</td>
            <td><input type="password" value="" class="text2" name="userpass" id="userpassid" /></td>
        </tr>
        <tr>
            <td width="60" height="40" align="right">&nbsp;</td>
            <td>
                <div class="c4">
                    <!--onclick-->
                    <input type="submit" value="登录" class="btn2" onclick="checkUser();"/>
                </div>
            </td>
    </table>
</form>

<script>
    function checkUser() {
        var result = document.getElementById("userid").value;
        var password = document.getElementById("userpassid").value;
        if (result == "") {
            alert("用户名不能为空");
            return false;
        }
        if (password == "") {
            alert("密码不能为空");
            return false;
        }
    }
    debugger;
    alert('Your data is correct.');
</script>
